Telemetry
The v7 telemetry integration seam (upstream's Telemetry, the revamped TelemetryIntegration): implement it ONCE and the loop feeds it every lifecycle event of every invocation — agent start/finish, step start/finish, model-call start/finish, tool-call start/finish (including tool executions resumed after an approval pause), errors, and aborts. Upstream: "Instead of wiring up individual callbacks on every call, you implement a Telemetry once and register it globally or pass it via telemetry.integrations."
Event payloads reuse the lifecycle hook event types (OnStartEvent, OnStepFinishEvent, ...) — upstream: "The event types for each method are the same as the corresponding event callbacks." Each is paired with the invocation's TelemetryCall for correlation.
Contract:
Telemetry OBSERVES. It never alters loop behavior: a method throw is swallowed by the loop (CancellationException still propagates).
onToolCallStart/onToolCallFinish may fire CONCURRENTLY (a step's tool calls execute in parallel) — implementations must be thread-safe.
All methods default to no-ops; implement only what you record.
Functions
Exactly one of outputJson/errorMessage is non-null. NOT fired for a CANCELLED tool call — cancellation unwinds the loop, so integrations may see a start without a finish.